package com.veo.service;

import com.veo.entity.Book;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Service
public class BookService {

    @RabbitListener(queues = {"veo.books"})
    public void receive(Book book){
        System.out.println("接收到消息:"+book);

    }

    @RabbitListener(queues = {"veo.news"})
    public void receiveMsg(Message message){
        System.out.println("接收到消息---------------------------");
        System.out.println(message.getBody());
        System.out.println(message.getMessageProperties());

    }


}
